<div id="content">
    <div class="buttons">
        <div class="modal hide" id="modal-add-event">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal">×</button>
                <h3>上传图集(可多选图片)</h3>
            </div>

            <form action="" method="post" enctype="multipart/form-data" id="upMoreImg">
                <div class="modal-body">
                    <p>
                        <input id="fileImage" type="file" size="30" name="files[]" multiple />

                    </p>
                </div>
                <div class="modal-footer">
                    <a href="#" class="btn" data-dismiss="modal">Cancel</a>
                    <input type="submit" id="add-event-submit" class="btn btn-primary" value="上传">
                </div>
            </form>
        </div>
    </div>



    <div class="container-fluid">
    <hr>

    <div class="row-fluid">
      <div class="span12">

          <div class="controls controls-row">
              <form action="{:U('Goods/index')}" method="post" id="getCond">
                  <select name="cate_id" class="span3" onchange="getCond()">
                      <option value="null" selected="selected"> -- 选择栏目 ---</option>
                      <option value="all">全部商品</option>
                      <volist name="cate" id="vo">
                          <option value="{$vo.id}">{$vo.name}</option>
                      </volist>

                  </select>
              </form>
          </div>
          <script>
              function getCond()
              {
                  var one=$("select[name='cate_id']").val();
                  if(one!="null")
                  {
                      $("#getCond").submit();
                  }
              }
          </script>

        <div class="widget-box">
          <div class="widget-title">
              <span class="icon">
                <input type="checkbox" id="title-checkbox" name="title-checkbox" />
            </span>
            <h5>Static table with checkboxes</h5>
          </div>
          <div class="widget-content nopadding">
            <table class="table table-bordered table-striped with-check">
                  <thead>
                        <tr>
                            <th><i class="icon-resize-vertical"></i></th>
                            <th>排序</th>
                            <th>ID</th>
                            <th>商品编码</th>
                            <th>名称</th>
                            <th>updateTime</th>
                            <th>操作</th>
                        </tr>
                  </thead>

                <volist name="data" id="vo">
                    <tbody>
                        <tr>
                            <td><input type="checkbox" /></td>
                            <td><input class="span2" id="order{$vo.id}" name="order" type="text" value="{$vo.order}" data="{$vo.id}" onblur="order({$vo.id})"/></th>
                            <td>{$vo.id}</td>
                            <td>{$vo.goods_sn}</td>
                            <td class="center">{$vo.name}</td>
                            <td>{$vo.last_update}</td>
                            <td>
                                <a href="{:U('Goods/delGoods',array('id'=>$vo['id']))}" class="btn btn-inverse btn-mini">删除</a>
                                <a href="{:U('Goods/updataGoods',array('id'=>$vo['id']))}" class="btn btn-inverse btn-mini">修改</a>
                                <a id="add-event" data-toggle="modal" href="#modal-add-event" class="btn btn-inverse btn-mini" onclick="upMoreImg('{:U('Goods/upMoreImg/',array('id'=>$vo['id']))}')">上传图集</a>
                            </td>
                        </tr>
                    </tbody>
                </volist>
            </table>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>
<script src="__PUBLIC__js/fullcalendar.min.js"></script>
<script src="__PUBLIC__js/matrix.calendar.js"></script>
<script src="__PUBLIC__js/matrix.tables.js"></script>
<script>

    function order(id){
        var goodsID=id;
        var yanG1=$("#order"+id).val();

        $.ajax({
            url:"{:U('Goods/sort')}",

            type: 'POST',

            data:{
                goods_id:goodsID,
                sort_val:yanG1
            },

            dataType: 'html',

            timeout: 1000,

            error: function(){alert('Error loading PHP document');},

            success: function(result){
                alert(result);
            }
        });
    }
</script>